package cn.tedu.oop;
/**本类用于构造方法与方法重载的快速回顾*/
public class TestDog {
    public static void main(String[] args) {
        Dog d = new Dog();
        d.Play();//无参
        d.Play("二郎神");
        d.Play(3,"肉包子");
        d.Play("旺财",3);

        Dog d4 = new Dog();
        Dog d2 = new Dog("二郎神");
        Dog d3 = new Dog("",3,5);
        d2.Play();

    }
}
class Dog{
    String name;
    int age;
    double price;
    public void Play(){
        System.out.println("小狗喜欢玩飞盘");
    }
    public void Play(String host){
        System.out.println("小狗喜欢和主人"+host+"玩飞盘");
    }
    public void Play(int n,String food){
        System.out.println("小狗今晚要吃"+n+"份"+food);
    }
    public void Play(String name,int age){
        System.out.println("小狗"+name+"今年"+age+"岁了");
    }
    public Dog(){
        System.out.println("我是无参构造");
    }
    public Dog(String host){
        System.out.println("我是含参构造");
    }

    public Dog(String name, int age, double price) {
        this.name = name;
        this.age = age;
        this.price = price;
        System.out.println("我是全参构造");
    }
}
